package com.warningrc.util;

import java.net.URL;

import org.apache.log4j.Logger;

public class Utils {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = LoggerUtils.getLogger(Utils.class);

	public static String getClassPath(Class<?> cla) {
		return cla.getResource("/").getFile();
	}

	public static URL getClassPathResource(Class<?> cla, String file) {
		return cla.getResource(new StringBuilder("/").append(file).toString());
	}

	public static String getClassPathResource(String file) {
		return Utils.class.getResource(
				new StringBuilder("/").append(file).toString()).getFile();
	}

	public static void main(String[] args) {
		if (logger.isInfoEnabled()) {
			logger.info(Utils.class.getResource("/").toString());
		}
	}
}
